import request from '../utils/request'

export function getCustomerList(params) {
  return request({
    url: '/api/customers/page',
    method: 'get',
    params
  })
}

export function getCustomerById(id) {
  return request({
    url: `/api/customers/${id}`,
    method: 'get'
  })
}

export function createCustomer(data) {
  return request({
    url: '/api/customers',
    method: 'post',
    data
  })
}

export function updateCustomer(data) {
  return request({
    url: '/api/customers',
    method: 'put',
    data
  })
}

export function deleteCustomer(id) {
  return request({
    url: `/api/customers/${id}`,
    method: 'delete'
  })
}

export function updateCustomerPoints(id, points) {
  return request({
    url: `/api/customers/${id}/points`,
    method: 'put',
    params: { points }
  })
} 